﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core.Implements;
using Cofe.Core.Service;
using Cofe.Data;

namespace Cofe.Core
{
#if !NETFX_CORE
    /// <summary>
    /// Uses MEF plugin to register.
    /// </summary>
    public class AutoBootStrapper : BootStrapperBase
    {
        private string _libPath;
        public AutoBootStrapper(string libPath = null)
        {
            _libPath = libPath;
        }

        protected virtual void ConfigureServiceImporter(ManualServiceImporter msi)
        {
            msi.RegisterCOFECore();
        }

        public override IServiceImporter ConfigureServiceImporter()
        {
            MEFServiceImporter msi = String.IsNullOrEmpty(_libPath) ? new MEFServiceImporter() : new MEFServiceImporter(_libPath);
            return msi;
        }

    }
#endif
}
